feat(git): add channel-scoped private repositories#2539
Open
LordMelkor wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2469
What
Add explicit private visibility for Buzz-hosted Git repositories. A private
repository is discoverable and usable only by its repository owner, the verified
owner of a managed-agent repository, or a current member of its bound Buzz
channel.
This closes both read paths:
30617announcements, kind30618state events, WebSocket/HTTP query and count paths, search,pagination, and live fan-out;
info/refs,git-upload-pack, andgit-receive-pack.Denied Git requests return the same generic
404 repository not foundresponseas an absent repository. Repositories without an explicit private marker retain
their current behavior.
How
["buzz-visibility", "private"]["buzz-channel", "<channel-uuid>"]30617announcements before storage. Private metadata must beunambiguous and well formed, and the announcing owner must currently belong to
the selected channel.
crates/buzz-relay/src/api/git/access.rs; relay query, count, search,fan-out, HTTP bridge, and Smart HTTP handlers all delegate to that policy.
hidden rows cannot consume visible query limits or pagination slots.
than 20,000 candidates are rejected with a request for narrower constraints
rather than returning a truncated value.
work and fail closed on lookup or authorization errors.
--visibilityand--channeltobuzz repos create, plusbuzz repos editfor visibility changes.visibility in Desktop and web repository views.
buzz-channeltag as a write-policy binding when readvisibility is public.
surfaces.
Key decisions
Relay rejection is the visibility-edit UX
The relay remains authoritative for whether a private repository owner currently
belongs to the selected channel. Clients do not duplicate that policy with a
racy preflight check. Desktop surfaces the relay's
OKrejection message in itstoast, and the CLI includes the same relay message in its error. For example, an
invalid update reports that the private repository owner must be a current
member of
buzz-channel.Authorization uses the current kind
30617announcement on every requestEach discovery or Smart HTTP request resolves the current repository
announcement and then checks current channel membership. This is deliberate live
authorization: removing a member revokes access on the next request, without
stale repository ACL state or a second source of truth. The extra lookup is
preferred over cached or denormalized authorization because correctness and
immediate revocation are the primary requirements.
Privacy is explicit and backward compatible
Only an exact
["buzz-visibility", "private"]opt-in makes a repositoryprivate. A pre-existing
buzz-channeltag by itself continues to control pushpolicy only, so existing repositories do not silently change read visibility.
Changing a private repository back to public preserves that push binding.
Denials do not reveal repository existence
Authorization failures and missing repositories use the same
404 repository not foundresponse on Smart HTTP endpoints. Malformed private discovery metadataand lookup failures fail closed.
Manual test
Create a channel with a repository owner and a second member. Keep a third
authenticated user outside the channel.
In Desktop’s create dialog, choose the Private radio card. Confirm the
channel picker appears only for Private, select the channel, and create the
project. With an identity that belongs to no eligible non-DM channels,
confirm the dialog says Join a channel to create a private project and
keeps Create project disabled.
Confirm a Lock icon marks the private project in grid, list, and overview
rail rows. Open the project as the owner, open the Private · #channel
badge menu, and confirm Public and the eligible channel choices are separate
menu decisions rather than one flat list.
Open the project as the second channel member. Confirm the read-only badge
says Private · #channel and its tooltip says only channel members and the
owner can access the project.
Confirm the owner and channel member can find the project, open its
repository page, and clone or run
git ls-remoteagainst its exact cloneURL.
Confirm the non-member cannot find the project through listing or search.
Give the non-member the exact clone URL and confirm
git ls-remotereports404 repository not found.Remove the second member from the channel. Without restarting the relay or
client, repeat discovery and
git ls-remote; confirm access is denied on thenext request.
As the owner, choose Public from the project badge menu. Confirm an
AlertDialog asks Make this project public? and warns that anyone in the
workspace will be able to find and clone it. Cancel once and confirm nothing
changes; then confirm the transition and verify the former non-member can
discover and read it while the existing channel-based push policy remains
intact. Confirm Public→Private and private-channel changes do not ask for
confirmation.
Exercise the CLI equivalents:
Attempt to create or update a private repository with a channel the owner has
not joined. Confirm Desktop and CLI display the relay rejection message.
Verify a legacy repository that has
buzz-channelbut nobuzz-visibilitytag remains readable under the existing rules.
Deferred work
None. This PR includes relay enforcement, discovery filtering, Git endpoint
protection, CLI and Desktop controls, web visibility display, compatibility
behavior, documentation, and automated coverage.
Validation
just cipasses with the repository-pinned Hermit toolchain at0482aba696decd3cc518ff04d68147eac0f38d42.just test-integrationpasses at0482aba696decd3cc518ff04d68147eac0f38d42.all Smart HTTP endpoints and the over-20,000 discovery-count rejection
path.
unwrap()in production code paths.unsafeblocks.